package com.qeegoo.b2bautozityp.moudle.good.viewmodel.carmodel;

import android.databinding.ObservableField;

import com.kelin.mvvmlight.command.ReplyCommand;
import com.qeegoo.b2bautozityp.R;
import com.qeegoo.b2bautozityp.moudle.good.model.CarModelBean;

import base.lib.util.ActivityManager;

/**
 * 王少岩 在 2017/9/26 创建了它
 */

public class CarModelBeanViewModel {
    public ObservableField<String> name = new ObservableField<>("");
    public ObservableField<Boolean> isSelected = new ObservableField<>(false);
    public ObservableField<Integer> blue = new ObservableField<>(ActivityManager.getActivity().getResources().getColor(R.color.blue));
    public ObservableField<Integer> normal = new ObservableField<>(ActivityManager.getActivity().getResources().getColor(R.color.text_normal));

    public CarModelBean mBean;
    private CarModelSelectViewModel mViewModel;

    public CarModelBeanViewModel(CarModelBean bean) {
        this.mBean = bean;
        this.name.set(bean.modelName);
    }

    public CarModelBeanViewModel(CarModelSelectViewModel viewModel, CarModelBean bean) {
        mViewModel = viewModel;
        this.mBean = bean;
        this.name.set(bean.modelName);
    }

    public ReplyCommand delCommand = new ReplyCommand(() -> mViewModel.delItem(this));
}
